
Partial Class FilterEdit
    Inherits System.Web.UI.Page
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim FilterDateId As String = Request.QueryString("FilterDateId")
    If Not Page.IsPostBack Then
      If FilterDateId = "0" Or FilterDateId = "" Then
        FormView1.ChangeMode(FormViewMode.Insert)
      Else
        FormView1.ChangeMode(FormViewMode.Edit)
        sqlFilters.DataBind()
      End If
    End If

  End Sub

  Protected Sub Page_PreRenderComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRenderComplete
    If Page.IsPostBack Then
      Response.Redirect("~/Filters.aspx")
    End If
  End Sub
End Class
